package com.xuewei.pagedemo.util;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by LeiPeng on 2014/03/20.
 */
public class PagerResult<T extends Serializable> implements Serializable {
	private static final long serialVersionUID = -1169577196405160699L;

	private List<T> dataList;

	private long totalCount;
	
	public PagerResult(long totalCount,List<T> dataList){
		this.totalCount=totalCount;
		this.dataList=dataList;
	}
	
	public PagerResult(){
		
	}
	
	public List<T> getDataList() {
		if (dataList == null) {
			dataList = new ArrayList<T>();
		}
		return dataList;
	}

	public void setDataList(List<T> dataList) {
		this.dataList = dataList;
	}

	public long getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(long totalCount) {
		this.totalCount = totalCount;
	}

	@Override
	public String toString() {
		return "PagerResult{" +
				"dataList=" + dataList +
				", totalCount=" + totalCount +
				'}';
	}
}
